// This file defines the table file auotmation structure
// Copyright (c) 2004,8-15
// Define and implemented by Dr. Liang Jun
#ifndef _DAP_TAB_FILE_
#define _DAP_TAB_FILE_
#include "DAPCore.h"
///////////////////////////////////////////////////////////////////
// Define the field
class AFX_EXT_CLASS CDAPTabField : public CDAPObj
{
// Constructor
public:
	CDAPTabField(PTNO nID=0, DAPValueType nType=DAP_ERROR_TYPE);
	~CDAPTabField();
// Attribute
public:
	PTNO m_nFieldID;
	DAPValueType m_nValueType;
	DAPValue     m_uValue;
// Helper
public:
	void SetValue(CDAPString szValue);
};
//////////////////////////////////////////////////////////////////
// Defile row
class AFX_EXT_CLASS CDAPTabRow : public CDAPObj
{
public:
	CDAPTabRow();
	~CDAPTabRow();
// Attribute
public:
	CTypedPtrList<CObList, CDAPTabField *> m_lstRowValue;
public:
	void RemoveAll();
	bool CreateRow(CDAPTabRow &tabTitle);
	bool FormValue(CDAPString szValue);
};

/////////////////////////////////////////////////////////////////
//
class AFX_EXT_CLASS CDAPTabFile : public CTypedPtrList<CObList, CDAPTabRow *>
{
public:
	CDAPTabFile();
	~CDAPTabFile();
// Attribute
public:
	CDAPTabRow m_tabTitle;    // Title definition
// Helper
public:
	bool LoadFromFile(CDAPString szPathName);	
};
#endif